package ee.ttu.karileet.serviceshop.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import ee.ttu.karileet.serviceshop.dao.ServiceRequestDAO;
import ee.ttu.karileet.serviceshop.model.ServiceRequest;
import ee.ttu.karileet.serviceshop.service.ServiceRequestService;


@Service("serviceRequestService")
public class ServiceRequestServiceImpl implements ServiceRequestService {

	@Autowired
	private ServiceRequestDAO serviceRequestDao;
	
	@Override
	@Transactional
	public void insertServiceRequest(ServiceRequest serviceRequest) {
		serviceRequestDao.insertServiceRequest(serviceRequest);
	}

	@Override
	@Transactional
	public List<ServiceRequest> getServiceRequests() {
		return serviceRequestDao.getServiceRequests();
	}

	@Override
	@Transactional
	public ServiceRequest getServiceRequestById(long serviceRequestId) {
		return serviceRequestDao.getServiceRequestById(serviceRequestId);
	}

}
